<!--
 * @Description: 
 * @Author: 赵大壮
 * @Date: 2021-12-08 14:10:35
 * @LastEditTime: 2021-12-10 18:44:20
 * @LastEditors: 赵大壮
-->
<template>
  <div class="w-full h-full border flex flex-row items-center justify-center">
    <div class="p-w10 flex flex-row items-center" v-if="!path">
      <div class="text-f12">未上传图片</div>
    </div>
    <el-image :src="path" fit="fill" class="w-full h-full" v-else />
  </div>
</template>

<script lang="ts">
import { Component, Vue, Prop, Watch } from "vue-property-decorator";

@Component
export default class UiUploadOnlyImg extends Vue {
  @Prop() url: any;
  path = "";

  created() {}

  mounted() {}

  beforeDestroy() {}

  @Watch("url")
  watchValue(url: any, oldValue: string) {
    if (url != "") {
      this.path = url;
    }
  }

  initView() {
    this.path = "";
  }
}
</script>
<style lang="less" scoped>
</style>
